﻿@using brand.cyt369.com.MODELS
@{
    IQueryable<Category> categorys = ViewBag.categorys as IQueryable<Category>;
    Dictionary<int, IQueryable<brand.cyt369.com.models.Brand>> dict =ViewBag.dict as Dictionary<int, IQueryable<brand.cyt369.com.models.Brand>>;
}
<script src="./js/index/general.js"></script>
<input id="basePath" type="hidden" value="@brand.cyt369.com.utility.SystemSettingService.Instance.BrandInternalBucket.HttpURL" /> 
<div class="hot-top">
    <!-- 模块顶部的左边 -->
    <div class="hot-top-left">
        <!-- log地方 -->
        <i></i>
        <span>热门类别</span>
    </div>
    <!-- 模块顶部的右边 -->
    <div class="hot-top-right">
        <p class="hot-top-right-more">
            <a href="~/Search/Index/@Base64.ObjectToBase64(new {  page=1})" target="_blank">更多+</a>
        </p>
    </div>
</div>
<!-- 类别模块的内容部分 -->
<div class="defultBorder">
@if (categorys != null)
{
    foreach (var item in categorys)
    {
        @if (dict != null && dict[item.Id].Count()>0){
        <div class="general-card" >
            <div class="general-card-title">
                        <a href="~/Search/Index/@Base64.ObjectToBase64(new {  page=1,parentCategoryID=item.Id })" class="general-card-title-category" target="_blank">
                    <h3>@item.CategoryName</h3>
                </a>
                        <a href="~/Search/Index/@Base64.ObjectToBase64(new {  page=1,parentCategoryID=item.Id })" class="general-card-title-more" target="_blank">
                    <span>更多项目</span>
                </a>
                <ul class="general-card-title-menu">
                    @if (item.Childs != null)
                    {
                        foreach (var child in item.Childs)
                        {
                            <li class="general-card-title-menu-item">
                                        <a href="~/Search/Index/@Base64.ObjectToBase64(new {  page=1,categoryID=child.Id })" class="general-card-title-menu-name" target="_blank"><span>@child.CategoryName</span></a>
                            </li>
                        }
                    }
                </ul>
            </div>
            <div class="general-card-contentlist" id="@item.Id">
                @* 嵌入模板 *@
                @foreach(var b in dict[item.Id]){
                    <div class="general-card-content">
                        <div class="general-card-content-item">
                            <a href="Brand/Index/@Base64.ObjectToBase64(new { id=b.Id})" target="_blank">
                                    <img class="general-card-content-item-img" src="@string.Format("{0}/{1}",brand.cyt369.com.utility.SystemSettingService.Instance.BrandInternalBucket.HttpURL,b.BrandImages[0].ImagePath)" alt="" />
                                <div class="general-card-content-item-span">
                                    <div class="general-card-content-item-span-name">@b.Name</div>
                                    <div class="general-card-content-item-span-num">
                                        <span>@brand.cyt369.com.MODELS.BrandHelper.GetAmountString(b.Amount)</span>
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
                }
            </div>
        </div>
        }
    }
}
</div>
@* <div class="general-button-more">
    <span>展开更多品类</span>
    <i></i>
</div> *@